home *** CD-ROM | disk | FTP | other *** search
- #include "myIncludes.h"
- #include "myProtos.h"
-
- struct AEinstalls {
- AEEventClass theClass;
- AEEventID theEvent;
- EventHandlerProcPtr theProc;
- };
- typedef struct AEinstalls AEinstalls;
-
-
- void InitAEStuff(void);
- void InitAEStuff(void)
- {
- static AEinstalls HandlersToInstall[] =
- {
- { kCoreEventClass, kAEOpenApplication, AEOpenHandler}, /* the 4 required AppleEvents. */
- { kCoreEventClass, kAEOpenDocuments, AEOpenDocHandler},
- { kCoreEventClass, kAEQuitApplication, AEQuitHandler},
- { kCoreEventClass, kAEPrintDocuments, AEPrintHandler},
-
- { kChoirEventClass, STEP1, do_step1 },
- { kChoirEventClass, STEP2, do_step2 }
- };
- OSErr err;
- long aLong = 0;
-
- if ( Gestalt(gestaltAppleEventsAttr, &aLong) == noErr )
- {
- for (aLong = 0; aLong < ((sizeof(HandlersToInstall) / sizeof(AEinstalls))); aLong++)
- {
- err = AEInstallEventHandler(HandlersToInstall[aLong].theClass,
- HandlersToInstall[aLong].theEvent,
- HandlersToInstall[aLong].theProc, 0, false);
- if (err)
- ExitToShell();
- } /* for */
-
- err = PPCInit();
- }
- else
- ExitToShell();
- }